import service from '@/utils/request';

const prefix = '/user/group';

export function getUserGroupListService(params) {
  return service({
    url: `${prefix}/list`,
    method: 'get',
    params,
  });
}

export function getUserGroupDetailService(userGroupId) {
  return service({
    url: `${prefix}/detail`,
    method: 'get',
    params: { userGroupId },
  });
}

export function addUserGroupService(data = {}) {
  return service({
    url: `${prefix}/add`,
    method: 'post',
    data,
  });
}

export function editUserGroupService(data = {}) {
  return service({
    url: `${prefix}/edit`,
    method: 'put',
    data,
  });
}

export function deleteUserGroupService(userGroupId) {
  return service({
    url: `${prefix}/delete`,
    method: 'delete',
    params: { userGroupId },
  });
}

export function getUserGroupUserListService(params) {
  return service({
    url: `${prefix}/user/list`,
    method: 'get',
    params,
  });
}

export function updateUserGroupUserService(data = {}) {
  return service({
    url: `${prefix}/user/update`,
    method: 'put',
    data,
  });
}


export function updateExamUserGroupService(data = {}) {
  return service({
    url: `${prefix}/exam/update`,
    method: 'post',
    data,
  });
}

